<script setup lang='ts'>
import {  getClassifyAPI } from '@/api/api';
import { ref } from 'vue';
import {onReady, onShareAppMessage, onShareTimeline} from '@dcloudio/uni-app'

const classifyList = ref([])
async function getClassify() {
		const res = await getClassifyAPI({pageSize: 20})
		// console.log(res);
		classifyList.value = res.data
	}
	onReady(() => {
		getClassify()
	})
	
	// 分享给好友
	onShareAppMessage((e) => {
		return {
			title: '岁月壁纸分类',
			path: '/pages/classify/classify',
		}
	})
	
	// 分享朋友圈
	onShareAppMessage((e) => {
		console.log(e);
		return {
			title: '岁月壁纸分类'
		}
	})
</script>


<template>
	<view class="classify-layout pageBg">
		<custom-nav-bar title="分类"></custom-nav-bar>
		<view class="classify">
			<theme-item v-for="item in classifyList" :item="item" :key="item._id"></theme-item>
		</view>
	</view>
</template>


<style scoped lang='scss'>
	.classify-layout{
		.classify{
			display: grid;
			grid-template-columns: repeat(3, 1fr);
			gap: 15rpx;
			padding: 30rpx;
		}
	}
</style>
